<?php

namespace app\common\model;

use think\Model;

/**
 * QuestionUser
 */
class QuestionUser extends Model
{
    // 表名
    protected $name = 'question_user';

    // 自动写入时间戳字段
    protected $autoWriteTimestamp = true;

    protected $append = [
        'create_time_text',
    ];

    public function questionCoupon()
    {
        return $this->belongsTo(QuestionCoupon::class);
    }

    public function getCreateTimeTextAttr($value)
    {
        return date('Y-m-d H:i:s', $value);
    }
}
